import 'package:flutter/material.dart';

class LayoutDemo extends StatelessWidget {
  LayoutDemo({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
        appBar: AppBar(
          title: Text("布局练习"),
        ),
        body: Container(
          color: Colors.grey,

          // child: Row(
          //   textDirection: TextDirection.rtl,
          //   mainAxisSize: MainAxisSize.max,
          //   mainAxisAlignment: MainAxisAlignment.spaceAround,
          //   crossAxisAlignment: CrossAxisAlignment.end,
          //   children: [
          //     Container(
          //       color: Colors.red,
          //       width: 100,
          //       height: 150,
          //     ),
          //     Container(
          //       color: Colors.green,
          //       width: 100,
          //       height: 100,
          //     ),
          //     Container(
          //       color: Colors.yellow,
          //       width: 100,
          //       height: 100,
          //     ),
          //   ],
          // ),
          child: Flex(
            direction: Axis.vertical,
            children: [
              Expanded(
                child: Container(
                  color: Colors.red,
                  width: 150,
                  height: 100,
                ),
                flex: 1,
              ),
              Expanded(
                child: Container(
                  color: Colors.orange,
                  width: 150,
                  height: 100,
                ),
                flex: 2,
              ),
              Expanded(
                child: Container(
                  color: Colors.blue,
                  width: 150,
                  height: 100,
                ),
                flex: 1,
              ),
            ],
          ),
        ));
  }
}


class WrapDemo extends StatelessWidget {
  WrapDemo({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Row(
      children: [

      ],
    );
  }
}
